﻿using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;

public class GroupCell : MonoBehaviour {

	private List<Combination> combin;
	// Use this for initialization
	void Start () {

		if( combin == null ){
			return;
		}

		int index = 3;

		for( int i = 0 ; i < combin.Count ; i++ ){

			Texture2D texture = (Texture2D)Resources.Load ("image/ZJH/Txt/"+combin[i].getName(),typeof(Texture2D));

			if (texture == null) {
				transform.GetChild ( index).GetComponent<Image> ().sprite = null;
			} else {
				Sprite pic = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height), new Vector2(0.5f, 0.5f));
				transform.GetChild ( index).GetComponent<Image> ().sprite = pic;
			}
			index--;
		}
	}

	public void setCombination(List<Combination> value){
		combin = value;
	}

	public List<Combination> getCombination(){
		return combin;
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
